﻿using System;
using System.Globalization;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace FinalSilverlightProject.Helpers
{
    public class RoleToImageonverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var role = (string)value;
            if (role == "Administrators")
                return (ImageSource)(new BitmapImage(new Uri("../../Icons/Administrator.png", UriKind.Relative)));
            if (role == "Managers")
                return (ImageSource)(new BitmapImage(new Uri("../../Icons/Manager.png", UriKind.Relative)));
            if (role == "Stockmans")
                return (ImageSource)(new BitmapImage(new Uri("../../Icons/Stockman.png", UriKind.Relative)));
            if (role == "Customers")
                return (ImageSource)(new BitmapImage(new Uri("../../Icons/Customer.png", UriKind.Relative)));
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
